<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

       <input placeholder="输入" id="unDebounce">

       <script>  
                
        let inputa = document.getElementById('unDebounce')
        function ajaxRequest(content) {
            console.log( content[0] )
        }
        function debounceAjax(fm,time){
               let that=this
               let  timer=null
               return function  (){
                   clearTimeout(timer)
                   timer=setTimeout(()=>{
                       fm.call(that,arguments)
                   },time)
               }
                
        }
        let ajaxPost=debounceAjax(ajaxRequest,1000)
        inputa.addEventListener('keyup', function (e) {
               //console.log(e.target.value)
               let value=e.target.value
               ajaxPost(value)
        })

        
       



     

       </script>

</body>
</html>